﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
using Microsoft.SqlServer.Dts.Runtime;
using MSBIHelper.Helper;
using MSBIHelper.UI;
namespace MSBIHelper
{
    public partial class UI_TEST : Form
    {
        public UI_TEST()
        {
            InitializeComponent();
        }

        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_Notification>(true);
        }

        #region Form Logic

        private T ShowForm<T>() where T : Form, new()
        {
            return ShowForm<T>(false);
        }

        private T ShowForm<T>(bool fullScreen) where T : Form, new()
        {
            T form = (T)FormFactory.Create(typeof(T));
            form.MdiParent = this;
            form.Show();
            if (fullScreen)
                form.WindowState = FormWindowState.Maximized;
            form.Activate();
            return form;
        }
 
        #endregion

        private void addToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_Audit>(true);
        }

        private void oldVersionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<MSBI>(true);
        }

        private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_Configuration>(true);
        }

        private void haveATryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_try>(true);
        }
        private void userManualToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Util.GetUserManul();
        }
        
        private void AboutAuthorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_About>(false);
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.Application.Exit();
        }

        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_Setting>(true);
        }

        private void dWToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_DW>(true);
        }

        private void oLAPTESTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShowForm<Frm_SSAS>(true);
        }

        private void arrangeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void arrangeVertToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

    }
}
